import request from '@/utils/request'

// 查询客户投诉列表
export function listComplain(query) {
  return request({
    url: '/report/complain/list',
    method: 'get',
    params: query
  })
}

// 查询客户投诉详细
export function getComplain(id) {
  return request({
    url: '/report/complain/' + id,
    method: 'get'
  })
}

// 新增客户投诉
export function addComplain(data) {
  return request({
    url: '/report/complain',
    method: 'post',
    data: data
  })
}

// 修改客户投诉
export function updateComplain(data) {
  return request({
    url: '/report/complain',
    method: 'put',
    data: data
  })
}

// 删除客户投诉
export function delComplain(id) {
  return request({
    url: '/report/complain/' + id,
    method: 'delete'
  })
}


// 工厂下拉列表
export function getFactoryList() {
  return request({
    url: '/basic/factory/selectList',
    method: 'get'
  })
}


// 投诉率
export function clientComplaint() {
  return request({
    url: '/report/complain/complaint',
    method: 'get',
  })
}

// 近12个月  投诉率
export function complaintList() {
  return request({
    url: '/report/complain/complaintList',
    method: 'get',
  })
}
//时间判断
export function complaintRptTime(data) {
  return request({
    url: '/report/complain/complaintRptTime',
    method: 'put',
    data: data
  })
}